//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule
{
    /// <summary>
    /// The item model for all left pane items.
    /// </summary>
    public class RegistryManagerLeftPaneItemModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RegistryManagerLeftPaneItemModel"/> class.
        /// </summary>
        /// <param name="displayName">The display name.</param>
        /// <param name="rootKey">The root key.</param>
        /// <param name="isExpanded">if set to <c>true</c> [is expanded].</param>
        public RegistryManagerLeftPaneItemModel(string displayName, string rootKey, bool isExpanded)
        {
            this.DisplayName = displayName;
            this.RootKey = rootKey;
            this.IsExpanded = isExpanded;
        }

        /// <summary>
        /// Gets or sets the display name.
        /// </summary>
        /// <value>The display name.</value>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets or sets the root key.
        /// </summary>
        /// <value>The root key.</value>
        public string RootKey { get; private set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is expanded.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is expanded; otherwise, <c>false</c>.
        /// </value>
        public bool IsExpanded { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is initialized.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is initialized; otherwise, <c>false</c>.
        /// </value>
        public bool IsInitialized { get; set; }

        /// <summary>
        /// Overriding ToString method for the AutomationID.
        /// </summary>
        /// <returns>The display name.</returns>
        public override string ToString()
        {
            if (!string.IsNullOrEmpty(this.DisplayName))
            {
                return this.DisplayName;
            }
            return base.ToString();
        }
    }
}
